/**
 * Created by lenovo on 2017/5/9.
 */
import React from 'react';
// import evaluatePicUrl from '../img/evaluate.jpg';

class EvaluatePic extends React.Component{
    constructor(props){
        super(props);
        this.state={
            picUrl: ''
        }
    }

    componentDidMount(){
        this.setState({
            picUrl: this.props.picUrl
        })
    }

    componentWillReceiveProps(nextProps){
        const picUrl = nextProps.picUrl;
        this.setState({
            picUrl: picUrl
        })
    }

    render(){

        if(this.state.picUrl instanceof Array && this.state.picUrl !== []){
            const picList = this.state.picUrl.map(
                (item, index)=>{
                    return(
                        <img className="picSize" key={new Date()+index} src={item} />
                    )
                }
            );
            return(
                <div className="picBox">
                    {picList}
                </div>
            );
        }else{
            return (<div className=""></div>);
        }

    }
}

export default EvaluatePic;